1. Field of the Invention
This invention relates generally to computer software and database systems. More particularly, the invention relates to object-oriented databases and computer languages.
2. Description of the Related Art
Database systems are serving increasingly important roles in today""s society. Modern database systems enable users to gather, manipulate, and maintain massive amounts of information. A mere handful of examples of the myriad uses of database systems includes computerized library systems, automated teller machines, flight reservation systems, computerized parts inventory systems, and configuration databases for computer systems and networks.
Nevertheless, database systems are often difficult to maintain. Relational databases, for example, though powerful, are often accessible only through complicated, formal queries in languages such as SQL (Structured Query Language). It is expensive to hire or train experts with proficiency in such a highly technical field. Storage is also a problem, as data files in a database can become large and unwieldy, consuming finite storage resources. It is therefore an important consideration that a database system be easy to administer, and that the data be easy to enter, retrieve, edit, and store.
Some database systems are implemented using object-oriented techniques. Object-oriented databases, like the object-oriented programming model, are based on objects: units that combine or encapsulate both data and related methods for operating on that data. Often, objects are related to one another in a class hierarchy which allows related objects to inherit attributes from one another. Object-oriented databases thus provide more accurate modeling of xe2x80x9creal-worldxe2x80x9d entities. However, object-oriented databases are often just as difficult to implement, employ, and maintain as other types of databases. Furthermore, the interdependencies and relationships among objects in an object-oriented database complicate the issue of storage and often result in large, bloated database files which store unnecessary information.
One specific type of database is a database employed by an operating system to maintain configuration information that relates to components of software and/or hardware of a computer system. For example, such a configuration database may store configuration information relating to application programs, hardware devices which are coupled to the computer system, and/or elements of the operating system. These configuration databases may be implemented in many different ways. To exploit the advantages of the object-oriented paradigm, configuration databases may be implemented as object-oriented databases. Unfortunately, these configuration databases, object-oriented or otherwise, are associated with the same difficulties as other types of database systems. For instance, if information in a configuration database is generated dynamically upon the start-up of a computer system, then that information will be lost from session to session unless it is stored in a convenient way.
Therefore, it is desirable to provide an intelligent mechanism and process for storing an object-oriented configuration database.
The problems outlined above are in large part solved by various embodiments of a method and system for serializing a transient object-oriented database into a persistent form in accordance with the present invention. Serialization is the process of transforming one or more objects from a transient form to a persistent form. The transient elements of a database do not survive across runtime sessions. A persistent form produced through serialization, on the other hand, can be stored in nonvolatile memory.
In one embodiment, the persistent form is a grammatical form. A grammatical form is an expression of an object-oriented database in a textual form according to a grammar. The grammatical form is human-readable and human-editable. The grammatical form can be created by hand, or it can be created from an object-oriented database in transient form through the process of serialization. The grammar is designed to be platform-independent and programming-language-independent and therefore descriptive of any hierarchical object-oriented database. In one embodiment, the grammar comprises a set of keywords and a syntax.
In one embodiment, serialization requires that an object-oriented database be expressed as a plurality of entries in a transient, hierarchical, object-oriented form. The serializer navigates the tree of entries, writing each entry to the persistent form as text according to the grammar. In this way the textual, persistent form is generated. The persistent form can then be stored in one or more containers. The serialized form stores only the key state of the database, not a xe2x80x9csnapshotxe2x80x9d of memory as is the default in one embodiment. Therefore, the persistent, serialized form is smaller than the in-memory, transient form of the object-oriented database.
In various embodiments, the invention further provides a database transformation system and method wherein a persistent form which is described by a grammar is compiled into an intermediate form, wherein the intermediate form populates the active object-oriented database, and wherein serialization and compilation may be modified to accept complex data types.
In one embodiment, the object-oriented database is an object-oriented configuration database which stores configuration parameters pertaining to the software and hardware of a computer system, such as application programs, device drivers, system services, and other components. In one embodiment, the object-oriented database is a platform-independent one, such as the Java(trademark) System Database, and is therefore configured to be hosted on several different operating systems and computing platforms. In one embodiment, database transformation according to the present invention is implemented as a package of classes and interfaces in the object-oriented Java(trademark) Language.